package _作业.t1;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Demo {
    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Class<Student> studentClass = Student.class;
        Constructor<Student> constructor = studentClass.getConstructor(String.class, int.class);
        Student student = constructor.newInstance("柳岩",16);

        Method show = studentClass.getMethod("show");
        show.invoke(student);
    }
}
